package ExceptionsHomework;

import java.util.Arrays;

public class BuildArray 
{
	int[] a1; //= {8, 3, 10, 24, 0, 4, 7, 14};
	int[] a2; //= {4, 0, 5, 3, 9, 4};
	
	int[] devideArrays(int[] a1, int[] a2)
	{
		int[] a3;
		
		if(a1.length < a2.length)
		{
			a3 = new int[a1.length];
		}
		else
		{
			a3 = new int[a2.length];
		}
		
		for(int i = 0; i < i+1; i++)
		{
		try{
			a3[i] = a1[i] / a2[i];
		}
		catch(ArithmeticException ar){
			a3[i] = 0;
		}
		catch(ArrayIndexOutOfBoundsException oof)
		{
			break;
		}
		}
		
		return a3;
		}
	
}
